function dists = geo_dist(X, Y)

% calculate distance (in Kilometer) between two points (Lat,Lon)

a = pi / 180;
lat1 = X(:,2) .* a;%X(2,2) * a;
lat2 = Y(:,2) .* a;
lon1 = X(:,1) .* a;
lon2 = Y(:,1) .* a;
t1 = sin(lat1) .* sin(lat2);
t2 = cos(lat1) .* cos(lat2);
t3 = cos(lon1 - lon2);
t4 = t2 .* t3;
t5 = t1 + t4;
rad_dist = atan(-t5./sqrt(-t5.*t5+1)) + 2*atan(1);
dists = rad_dist *3437.73877 * 1.1508 * 1.6093470878864446;